/**
 * @file       PagingStrategy.h
 * @brief      The base class of Paging strategy
 * @author     Huabo Zheng
 * @date       Jan 31, 2012
 * @Copyright  2012, www.netgear.com Inc. All rights reserved.
 */

#ifndef PAGINGSTRATEGY_H_
#define PAGINGSTRATEGY_H_

#include "Object.h"
#include "Frame.h"

namespace NS_LCD_AFW
{

class CPageInfo;

/**
 *@class  CPagingStrategy
 *@brief  The base class of Paging strategy
 */
class CPagingStrategy: public NS_LCD_AFW::CObject
{
public:

	/**
	 *@brief Constructor
	 */
	CPagingStrategy();

	/**
	*@brief DeConstructor
	*/
	virtual ~CPagingStrategy();

public:

	/**
	 *@brief  Calculate page result
	 *@details     Calculate page result
	 *@param[in]  framePtrArray A array object that pointer to CFrame pointer object
	 *@param[in]  parentRect    The Rect of parent frame object
	 *@param[in]  pageResult    initial paging information
	 *@param[out] pageResult    Paging result
	 *@exception none
	 *@retval    int
	 *@return    ERR_SUCCESS if success,otherwise failure
	 *@note
	 *@attention
	*/
	virtual int calculatePaging(const CFramePtrArray &framePtrArray,
			const CRect &parentRect, CPageInfo &pageResult);

	/**
	 *@brief  find the hightlightable Object index from iStart to iEnd
	 *@details    find the hightlightable Object index from iStart to iEnd
	 *@param[in]  framePtrArray A array object that pointer to CFrame pointer object
	 *@param[in]  iStart    the start index
	 *@param[in]  iEnd      the end index
	 *@param[in]  bFindBackward if true then find from iStart to iEnd,else find from iEnd to iStart
	 *@exception none
	 *@retval    int
	 *@return    ERR_SUCCESS if success,otherwise failure
	 *@note
	 *@attention
	*/
	virtual int findNextHightlightableObjectIndex(
			const CFramePtrArray &framePtrArray, int iStart, int iEnd,bool bFindBackward = true);


	/**
	 *@brief  Calculate the view port
	 *@details    Calculate the view port
	 *@param[in]  framePtrArray A array object that pointer to CFrame pointer object
	 *@param[in]  parentRect    The Rect of parent frame object
	 *@param[in]  pageResult    initial paging information
	 *@param[out] pageResult    Paging result
	 *@exception none
	 *@retval    int
	 *@return    ERR_SUCCESS if success,otherwise failure
	 *@note
	 *@attention
	*/
	virtual int calculateViewPort(const CFramePtrArray &framePtrArray,
			const CRect &parentRect, CPageInfo &pageResult) = 0;

};

} /* namespace NS_LCD_AFW */
#endif /* PAGINGSTRATEGY_H_ */
